package com.biz.primus.homepage.vo;

import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * Created by defei on 2/5/17.
 */
@Data
public class CoverReqVo implements Serializable {

    /**
     * 城市Id
     */
    private Integer cityId;

    /**
     * 门店Id 与depotCode 和 warehouseDepotCode 互斥
     */
    private Long depotId;

    /**
     * 门店编码
     */
    private String depotCode;

    /**
     * 省仓门店编码
     */
    private String warehouseDepotCode;

    /**
     * 当前定位纬度(非必传)
     */
    private BigDecimal latitude;

    /**
     * 当前定位经度(非必传)
     */
    private BigDecimal longitude;

    /**
     * 模板url,当首页数据无需渲染时,此参数为模板唯一标识(非必传)
     */
    private String coverUrl;

    /**
     * 用户等级
     * 用于获取商品会员价格
     */
    private Integer userLevel;


    /**
     * 不传,中间参数
     */
    private String coverId;



    @Override
    public boolean equals(Object o) {

        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        CoverReqVo that = (CoverReqVo) o;

        return !(cityId != null ? !cityId.equals(that.cityId) : that.cityId != null) &&
                !(depotCode != null ? !depotCode.equals(that.depotCode) : that.depotCode != null) &&
                !(warehouseDepotCode != null ? !warehouseDepotCode.equals(that.warehouseDepotCode) : that.warehouseDepotCode != null) &&
                !(depotId != null ? !depotId.equals(that.depotId) : that.depotId != null) &&
                !(coverUrl != null ? !coverUrl.equals(that.coverUrl) : that.coverUrl != null);

    }

    @Override
    public int hashCode() {

        int result = cityId != null ? cityId.hashCode() : 0;
        result = 31 * result + (depotCode != null ? depotCode.hashCode() : 0);
        result = 31 * result + (warehouseDepotCode != null ? warehouseDepotCode.hashCode() : 0);
        result = 31 * result + (depotId != null ? depotId.hashCode() : 0);
        result = 31 * result + (coverUrl != null ? coverUrl.hashCode() : 0);
        return result;
    }

}
